package com.sync.data.mce.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.sync.data.base.BaseEntity;
import com.sync.data.base.CoreField;
import com.sync.data.common.annotation.FieldProps;
import com.sync.data.common.annotation.FieldType;
import com.sync.data.common.annotation.RenderType;
import com.sync.data.common.obj.annoation.ObjectPrefix;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 经销商协议表实体类
 */
@Getter
@Setter
@Entity
@ObjectPrefix("ddae")
public class DmsDistAgreement extends BaseEntity {

    //既要新增也要手动选择
    @FieldProps(type = FieldType.STRING, label = "客户" ,sourceObject = "ViewCustomer", renderField = "viewCustomer", renderType = RenderType.SourcePicker)
    private String customer;

    @OneToOne(fetch= FetchType.LAZY)
    @JoinColumn(name = "customer", referencedColumnName = "id", insertable = false, updatable = false)
    @NotFound(action = NotFoundAction.IGNORE)
    private ViewCustomer viewCustomer;



}

